package com.ysd.lis.controller.eq;


import com.ysd.common.Result;
import com.ysd.lis.controller.pub.BaseController;
import com.ysd.lis.entity.eq.EqSupplier;
import com.ysd.lis.request.EqSupplierDto;
import com.ysd.lis.request.lab.SupplierPageParam;
import com.ysd.lis.service.eq.EqSupplierService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 设备管理-供应商 前端控制器
 * </p>
 *
 * @author WH
 * @since 2024-07-30
 */
@RestController
@RequestMapping("/api/eq/supplier")
public class EqSupplierController extends BaseController {

    @Autowired
    private EqSupplierService eqSupplierService;

    @ApiOperation("分页查询")
    @GetMapping("/findSupplierPageList")
    public Result findSupplierPageList(SupplierPageParam pageParam) {
        return eqSupplierService.findSupplierPageList(pageParam);
    }

    @ApiOperation("新增")
    @PostMapping("/addSupplier")
    public Result addSupplier(@RequestBody EqSupplier eqSupplier) {
        return eqSupplierService.addSupplier(eqSupplier);
    }

    @ApiOperation("修改")
    @PostMapping("/editSupplier")
    public Result editSupplier(@RequestBody EqSupplier supplier) {
        return eqSupplierService.editSupplier(supplier);
    }

    @ApiOperation("根据详情id删除详情数据")
    @PostMapping("/deleteSupplier")
    public Result deleteSupplier(@RequestBody EqSupplier supplier) {
        return eqSupplierService.deleteSupplier(supplier);
    }

    @ApiOperation("批量删除")
    @PostMapping("/batchDeleteSupplierList")
    public Result batchDeleteSupplierList(@RequestBody EqSupplierDto dto) {
        return eqSupplierService.batchDeleteSupplierList(dto);
    }


}
